package msi.gama.display.java3d;

import java.awt.Color;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;

import msi.gama.common.interfaces.IDisplaySurface;
import msi.gama.common.interfaces.IGraphics;
import msi.gama.display.java3d.renderer.J3DRenderer;
import msi.gama.metamodel.agent.IAgent;
import msi.gama.metamodel.shape.ILocation;
import msi.gama.metamodel.shape.IShape;
import msi.gama.outputs.display.AbstractDisplayGraphics;
import msi.gama.runtime.IScope;

/**
 * minhvv, p18, IFI, TPE 01/2014 - 07/2014
 */

public class J3DDisplayGraphics extends AbstractDisplayGraphics implements IGraphics {

	public J3DDisplayGraphics(IDisplaySurface surface) {
		super(surface);
		System.err.println("J3DDisplayGraphics created!");
	}

	@Override
	public Rectangle2D drawGrid(IScope scope, BufferedImage img,
			double[] gridValueMatrix, boolean isTextured,
			boolean isTriangulated, boolean isGrayScaled, boolean isShowText,
			Color gridColor, double cellSize, String name) {
		System.out.println("J3DDisplayGraphics.drawGrid()");
		return null;
	}

	@Override
	public Rectangle2D drawImage(IScope scope, BufferedImage img,
			ILocation locationInModelUnits, ILocation sizeInModelUnits,
			Color gridColor, Double angle, boolean isDynamic, String name) {
		System.out.println("J3DDisplayGraphics.drawImage()");
		return null;
	}

	@Override
	public Rectangle2D drawString(String string, Color stringColor,
			ILocation locationInModelUnits, Double heightInModelUnits,
			String fontName, Integer styleName, Double angle, Boolean bitmap) {
		System.out.println("J3DDisplayGraphics.drawString()");
		return null;
	}

	@Override
	public Rectangle2D drawGamaShape(IScope scope, IShape geometry,
			Color color, boolean fill, Color border, boolean rounded) {

		IAgent agent = scope.getAgentScope();
		if (null != agent) {
			J3DRenderer.renderGeometry(agent, geometry, color, fill, border, rounded);
		}

		return null;
	}

	@Override
	public Rectangle2D drawChart(IScope scope, BufferedImage chart, Double z) {
		// System.out.println("J3DDisplayGraphics.drawChart()");
		return null;
	}

	@Override
	public void fillBackground(Color bgColor, double opacity) {
		// System.out.println("J3DDisplayGraphics.fillBackground()");

	}

	@Override
	public void setQualityRendering(boolean quality) {
		// System.out.println("J3DDisplayGraphics.setQualityRendering()");

	}

	@Override
	public void endDrawingLayers() {
		// System.out.println("J3DDisplayGraphics.endDrawingLayers()");

	}

	@Override
	public void beginHighlight() {
		// System.out.println("J3DDisplayGraphics.beginHighlight()");

	}

	@Override
	public void endHighlight() {
		// System.out.println("J3DDisplayGraphics.endHighlight()");
	}

}
